# 微服务名称
NAME = micro-service

# protoc 文件夹
API_PROTO_FILES=$(shell find api -name *.proto)


.PHONY: init
init:
	go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
	go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
	sudo apt install -y protobuf-compiler

.PHONY: api
# generate api proto
api:
	protoc --proto_path=. 							\
 	       --go_out=paths=source_relative:. 		\
 	       --go-grpc_out=paths=source_relative:. 	\
	       $(API_PROTO_FILES)